package com.wys.singleton_demo.enum1;

/**
 * 登记式单例
 *
 * JDK 底层就实现类 不会被创建出2个对象 保证的对象单例
 */
public enum EnumSingleton {
    INSTANCE;

    private Object data;

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static EnumSingleton getInstance(){
        return INSTANCE;
    }
}